<template>
	<view class="new-item" @click="Jump('/pagesA/news/detail/detail?id='+item.id)">
		<view class="type1 flex-between" v-if="imageList.length<3">
			<view class="left flex-column flex-between ">
				<view class="title otp2">
					{{item.title}}
				</view>
				<view class="des otp2">
					{{item.content_abstract}}
				</view>
				<view class="times flex">
					<view class="times-1 flex">
						来源：同在优选
					</view>
					<view class="times-2">
						{{item.ctime | getDateDiff}}
					</view>
				</view>
			</view>
			<view class="right">
				<m-image wh="231 136" :src="imageList[0]"></m-image>
			</view>
		</view>
		<view class="type2" v-else>
			<view class="title otp2">
				{{item.title}}
			</view>
			<view class="des otp2">
				{{item.content_abstract}}
			</view>
			<view class="image-box">
				<m-image wh="225 169" :src="item2" v-for="(item2,idx) in imageList" :key="idx" radius="10"></m-image>
			</view>
			<view class="times flex">
				<view class="times-1 flex">
					来源：同在优选
				</view>
				<view class="times-2">
					{{item.ctime | getDateDiff}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"m-new-item",
		data() {
			return {
				
			};
		},
		props: {
			item: {
				type: Object,
				default: ()=>{
					picurl:''
				}
			},
		},
		computed:{
			imageList(){
				return  this.item.picurl.split(',')
			},
		},
	}
</script>

<style lang="scss">
	.new-item{
		padding: 0 25rpx;
		background: #fff;
		margin-bottom: 20rpx;
		.type1{
			padding: 25rpx 0;
			border-radius: 10rpx;
			overflow: hidden;
			.left{
				align-items: flex-start;
				flex: 1;
				height: 156rpx;
				.title{
					font-size: 28rpx;
					font-family: PingFang SC-Bold, PingFang SC;
					font-weight: bold;
					color: #333333;
				}
				.des{
					padding: 10rpx 0;
					font-size: 24rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #bababa;
				}
				.times{
					font-size: 24rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
					
					.times-2{
						padding-left: 15rpx;
					}
				}
			}
			.right{
				margin-left: 25rpx;
			}
		}
		
		.type2{
			padding: 25rpx 0;
			border-bottom: 1rpx solid #EEEEEE;
			.title{
				font-size: 28rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #333333;
			}
			.des{
				padding: 20rpx 0;
				font-size: 24rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;
			}
			.image-box{
				display: grid;
				grid-template-columns: 1fr 1fr 1fr;
				grid-gap: 15rpx;
			}
			.times{
				padding-top: 10rpx;
				font-size: 24rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
				
				.times-2{
					padding-left: 15rpx;
				}
			}
			
		}
	}
</style>